with open('MOL.acpype/MOL_GMX.top') as file:
    top_lines=file.readlines()

with open('MOL.acpype/MOL_GMX.itp') as file:
    itp_lines=file.readlines()

end1=7
end2=14

for (idx,line) in enumerate(top_lines):
    if '#include "MOL_GMX.itp"' in line:
        end1=idx
    if '[ system ]' in line:
        end2=idx

all_top=top_lines[:end1]
all_top.extend(itp_lines)
all_top.extend('\n')
all_top.extend('\n')
all_top.extend(top_lines[end2:])

with open('Lig.top','w') as file:
    file.writelines(all_top)